package com.stone.cat.web.controller;

import com.stone.cat.common.constant.ViewConstant;
import com.stone.cat.facade.pojo.response.CatBaseResponseDTO;
import com.stone.cat.facade.pojo.vo.TopVO;
import com.stone.cat.facade.service.HomeManagerService;
import com.stone.cat.persist.config.CASConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpSession;

/**
 * Created by 喵 on 2018/1/30.
 */

@Controller
public class HomeController {

    @Autowired
    private CASConfig casConfig;
    @Autowired
    private HomeManagerService homeManagerService;

    @GetMapping(value = {"", "/index", "/home"})
    public String index() {
        return ViewConstant.INDEX;
    }

    @GetMapping(value = {"/listTop"})
    @ResponseBody
    public CatBaseResponseDTO<TopVO> listTop() {
        return this.homeManagerService.listTop();
    }




}
